﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<WRSManagementSystem.DomainModel.Entities.StoreItem>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Magazyn</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Id
            </th>
            <th>
                Nazwa
            </th>
            <th>
                Typ
            </th>
            <th>
                Opis
            </th>
            <th>
                Ilość
            </th>
            <th>
                Jednostka
            </th>
            <th>
                Wartość jednostkowa
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edytuj", "Edit", new {  id=item.Id }) %> |
                <%= Html.ActionLink("Szczegóły", "Details", new { id = item.Id })%>
            </td>
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Type.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
            <td>
                <%= Html.Encode(item.Quantity) %>
            </td>
            <td>
                <%= Html.Encode(item.Type.Unit.ShortCut) %>
            </td>
            <td>
                <%= Html.Encode(item.Price) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Dodaj przedmioty do magazynu", "Create") %>
    </p>

    <p>
        <%= Html.ActionLink("Dodaj nowy typ przedmiotu", "Create", "Type")%>
    </p>

    <p>
        <%= Html.ActionLink("Dodaj nową jednostkę", "Create", "Unit")%>
    </p>

</asp:Content>

